from time import time

def bubble(b):
    st = time()
    with open('m1_sorted.txt') as f:
        a = []
        for line in f:
            a.append([int(x) for x in line.split()])
    for i in range(len(a)):
        for j in range(len(a)-i-1):
            if a[j] > a[j+1]:
                a[j], a[j+1] = a[j+a], a[j]
    #print(a)
    fi = time()
    t = fi - st
    print('time ', name, ':', t)

bubble('m1_sorted.txt')
bubble('m2_revers.txt')          
bubble('m3_shuffle.txt')
